package com.xuecheng.manage_cms.web.controller;

import com.xuecheng.api.cms.CmsConfigControllerApi;
import com.xuecheng.api.cms.CmsPageControllerApi;
import com.xuecheng.framework.domain.cms.CmsConfig;
import com.xuecheng.framework.domain.cms.CmsPage;
import com.xuecheng.framework.domain.cms.request.QueryPageRequest;
import com.xuecheng.framework.domain.cms.response.CmsPageResult;
import com.xuecheng.framework.model.response.QueryResponseResult;
import com.xuecheng.framework.model.response.ResponseResult;
import com.xuecheng.manage_cms.service.CmsConfigService;
import com.xuecheng.manage_cms.service.PageService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author gongfeiyue
 * @date 2020/5/18 11:09
 * @Description
 */
@RestController
@RequestMapping(value = "/cms/config")
@Slf4j
public class CmsConfigController implements CmsConfigControllerApi{
  @Autowired
  private CmsConfigService cmsConfigService;
  /**
  * @Author: gongfy
  * @Param:  id
  * @Return:  CmsConfig
  * @Date: 2020/7/9 17:02
  * @Description: 根据id获取页面配置
  **/
  @Override
  @GetMapping(value = "/getModel/{id}")
  public CmsConfig getmodel(@PathVariable(name = "id") String id) {
    CmsConfig cmsConfig = cmsConfigService.getConfigById(id);
    log.info("*********查询结果*********："+cmsConfig);
    return cmsConfig;
  }
}
